//************************************************************
//    > File Name: string.cpp
//    > Author: davis
//    > Mail:  
//    > Created Time: 2017年03月17日 16:12:24
//***********************************************************

#include<bits/stdc++.h>
#include<string>
using namespace std;
int main()
{
	string s="the sky is blue";
	reverse(s.begin(),s.end());
	cout<<s<<" s.length() is "<<s.length()<<endl;

	int end =0,begin=0;
	begin = s.find_first_not_of(" ",4);
	end =s.find(" ",4);
	cout<<"s.find_first_not_of(" ",4) is "<<begin<<"  s.find(" ",4) is "<<end<<endl;

	move(s.begin()+6,s.begin()+8,s.begin()+6);
	cout<<s<<endl;
	move(s.begin(),s.begin()+1,s.begin()+5);
	cout<<s<<endl;
	move(s.begin()+1,s.begin()+3,s.begin()+5);
	cout<<s<<endl;

}


/*****************
 eulb si yks eht s.length() is 15
 s.find_first_not_of(,4) is 5  s.find(,4) is 4
 eulb si yks eht
 eulb ei yks eht
 eulb ul yks eht
***********************/
